@layout("/common/_container.html"){
<script type="text/javascript">
	var ctx="${ctxPath}";
	var grid_selector = "#grid-table";
	var pager_selector = "#grid-pager";
	var export_source = "user.oraclelist";
	if("${func.isMySql()}" == "true"){
		export_source = "user.mysqllist";
	}
	
	$(function(){
		initZtree();
	});
		
	function initZtree(){
		var setting = {
				check: {
					enable: true,
					chkboxType:{"Y" : "s", "N" : "ps"}
				},
				data: {
					simpleData: {
						enable: true
					}
				}
			};	
		var ajax = new Ajax("${ctxPath}/user/userTreeList", function(data){
			if(data.code === 0){
				$.fn.zTree.init($("#zTree"), setting, data.data);
			}
			else{
				layer_alert("数据加载失败", "error");
			}
		});
		ajax.start();
	}
	
	/**
	获取选中的用户信息
	**/
	function getSelectUser(){
		var treeObj=$.fn.zTree.getZTreeObj("zTree");
        var nodes=treeObj.getCheckedNodes(true);
        if(nodes.length==0){
        	 layer_alert('请至少选择一个用户!',"warn");
             return;
        }
        var selectedNodes=new Array();
        for(var i=0;i<nodes.length;i++){
        	if(nodes[i].nodetype=='user'){
        		selectedNodes.push(nodes[i]);
        	}
        }
        if(selectedNodes.length==0){
       	 	layer_alert('请至少选择一个用户!',"warn");
            return;
       	}
        return selectedNodes;
	}
</script>


	<!-- 配置grid -->
	<div class="row">
		<div class="col-sm-1"></div>
		<div class="col-sm-10">
			<div class="widget-box widget-color-yn">
				<div class="widget-header">
					<h4 class="widget-title lighter smaller">部门组织架构及人员</h4>
				</div>

				<div class="widget-body">
					<div class="widget-main padding-8">
						<ul id="zTree" class="ztree"></ul>
					</div>
				</div>
			</div>
		</div>
		<div class="col-sm-1"></div>
	</div>
	
	<!-- 引入列表页所需js -->
	@include("/common/_listscript.html"){}
	<link rel="stylesheet" href="${ctxPath}/static/zTree/css/zTreeStyle/zTreeStyle.css" />
	<script src="${ctxPath}/static/zTree/js/jquery.ztree.core.js" type="text/javascript" ></script>
	<script src="${ctxPath}/static/zTree/js/jquery.ztree.excheck.js" type="text/javascript"></script>
	<style type="text/css">
		.ztree li span.button.iconPerson_ico_docu{margin-right:2px; background: url(${ctxPath}/static/zTree/img/person.png) no-repeat scroll 0 0 transparent; vertical-align:top; *vertical-align:middle}
	</style>
@}	